package com.itbaizhan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/c9")
public class MyController9 {
    @RequestMapping("/t1")
    public String t1(){
        System.out.println("控制器方法");
        return "result";
    }

    @RequestMapping("/t2")
    public String t1(Model model){
        model.addAttribute("name","sbiiii白痴sbsb");
        return "result";
    }


    @RequestMapping("/t3")
    @ResponseBody
    @CrossOrigin("http://localhost:8080")
    public String t3(){
        System.out.println("测试跨域请求");
        return "success";
    }

}
